#!/bin/sh


#echo $@
#public_ip=$1
#replace the public ip address public_ip_address
#sed -i.bak s/public_ip_address/$1/g /lxr/lxr.conf
#sed -i.bak s/public_ip_address/$1/g /lxr/custom.d/apache-lxrserver.conf

cp /lxr/custom.d/apache-lxrserver.conf  /etc/apache2/conf-available
a2enconf apache-lxrserver.conf
a2enmod ssl
a2enmod rewrite

#shift 
#index=0
#while [ $# -gt 0 ]
#do
#sed -i.bak s/VERSION$index/$1/g /lxr/lxr.conf
#mkdir -p /lxr/glimpse_db/lxr/$1
#shift
#index=$(($index+1))
#done

#while [ $index -le 9 ]
#do
#sed -i.bak s/VERSION$index//g /lxr/lxr.conf
#index=$(($index+1))
#done

#service mysql start
#expect /lxr/expect_initdb


service apache2 start

cd /lxr
#./genxref  --allurls

exec "/bin/bash"
